package com.etongwl.testmode;

import android.annotation.TargetApi;
import android.graphics.Color;
import android.os.Build;
import android.os.HandlerThread;
import android.os.Looper;
import android.os.Message;
import android.os.MessageQueue;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.text.SpannableString;
import android.text.SpannedString;
import android.util.Log;
import android.widget.TextView;

public class MainTestActivity extends AppCompatActivity {

    private TextView textView;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main_test);
//        HandlerThread
//        MessageQueue
//        Message
//        Looper
        textView= (TextView) findViewById(R.id.activity_test_text);
        SpannableString str=TextChangeUtil.changeKeyColorForString("Hello World","Hello",getResources().getColor(R.color.colorAccent));

        SpannableString str1=TextChangeUtil.changeKeyColorForString(str,"orl", Color.parseColor("#FF4081"));

        Log.e(MainTestActivity.class.getName(),":"+getResources().getColor(R.color.colorAccent)+","+Color.parseColor("#FF4081"));

        textView.setText(str1);
    }
}
